#ifndef _TIMER_H
#define _TIMER_H
#include "sys.h"

void TIM1_PWM_Init(void);

#define PWM_TIM             TIM1
#define PWM_TIM_CLOCK       168000000

#define PWM_TIM_FREQ        40000         //HZ
#define PWM_TIM_PULSE       (PWM_TIM_CLOCK/(2*PWM_TIM_FREQ))
#define PWM_TIM_PULSE_TPWM  (PWM_TIM_CLOCK/(PWM_TIM_FREQ))


#define DEAD_TIME         ((u16) 5)
#define PWM_DEAD_TIME     (u16)((unsigned long long)PWM_TIM_CLOCK/2*(unsigned long long)DEAD_TIME/1000000000) 
	
#endif
